<?php 

	require_once("Seguranca.class.php");
	
	class TrocarUrl{
	
		private $includeUrl;
		
		public function __construct($url){
			
			$s = new Seguranca();
			
			if(!empty($url)){
				$s->segurancaSessao($url);
			}
			
			$url = $s->segurancaString($url);
			
			if(!empty($url) && file_exists("views/".$url.".php")){
				
				$this->includeUrl = require_once("views/".$url.".php");
			}
			else{
				
				if(strstr($_SERVER ['REQUEST_URI'],"home.php")){
					
					$this->includeUrl = require_once("home.php");
				}
				else{
					
					$this->includeUrl = require_once("index.php");		
				}
				
			}
			
			return $this->includeUrl;
		}
	}
?>